//*********************************************************
//
//    Copyright (c) Microsoft. All rights reserved.
//    This code is licensed under the Apache License, Version 2.0.
//    THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
//    ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
//    IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
//    PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************

namespace Microsoft.Research.ScientificWorkflow.UIDesigner
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Data;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Imaging;
    using System.Windows.Navigation;
    using System.Windows.Shapes;
    using Microsoft.Research.ScientificWorkflow.TridentUtilities;

    /// <summary>
    /// Interaction logic for ExecutionInfo.xaml
    /// </summary>
    public partial class ExecutionInfo : UserControl
    {
        /// <summary>
        /// Fired on click of TryAgain button.
        /// </summary>
        public event EventHandler TryAgain;

        /// <summary>
        /// Fired on click of Abort button.
        /// </summary>
        public event EventHandler Abort;

        /// <summary>
        /// Constructor.
        /// </summary>
        public ExecutionInfo()
        {
            InitializeComponent();
        }

        /// <summary>
        /// Fired on click of Try again.
        /// </summary>
        /// <param name="sender">
        /// Try again button.
        /// </param>
        /// <param name="e">
        /// RoutedEventArgs.
        /// </param>
        private void OnTryAgainClick(object sender, RoutedEventArgs e)
        {
            if (this.TryAgain != null)
            {
                this.TryAgain.Invoke(sender, new EventArgs());
            }
        }

        /// <summary>
        /// Fired on click of Abort.
        /// </summary>
        /// <param name="sender">
        /// Abort button.
        /// </param>
        /// <param name="e">
        /// RoutedEventArgs.
        /// </param>
        private void OnAbortClick(object sender, RoutedEventArgs e)
        {
            if (this.Abort != null)
            {
                this.Abort.Invoke(sender, new EventArgs());
            }
        }
    }
}
